package com.atguigu.spring6.tx;

import com.atguigu.spring6.tx.config.MyConfig;
import com.atguigu.spring6.tx.controller.BookController;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestAnno {

    @Test
    public void testBuyBook() {
        ApplicationContext context = new AnnotationConfigApplicationContext(MyConfig.class);
        BookController bookController = (BookController)context.getBean("bookController");
        bookController.buyBook(1, 1);
    }
}
